/* eslint-disable no-debugger */
// useFetchUserInfo.js
import { useDispatch, useSelector } from "react-redux";
import { getUserInfo } from "@/store/modules/global";
const useFetchUserInfo = () => {
	const dispatch = useDispatch();
	// @ts-ignore
	const userInfo = useSelector(state => state.global.userInfo.Info);
	// @ts-ignore
	const isLoading = useSelector(state => state.global.userInfo.isLoading);

	const fetchUser = () => {
		console.log(dispatch);

		// @ts-ignore
		dispatch(getUserInfo());
	};

	return { userInfo, isLoading, fetchUser };
};

export default useFetchUserInfo;
